Skip to content

Conversation

@wolfchkov
Copy link

1. Does this PR affect any open issues?(Y/N) and add issue references (e.g. "fix #123", "re #123".):

  • N
  • Y

fix #664

2. What is the scope of this PR (e.g. component or file name):

pkg/downloader/downloader.go
pkg/downloader/downloader_test.go

3. Provide a description of the PR(e.g. more details, effects, motivations or doc link):

  • Affects user behaviors
  • Contains syntax changes
  • Contains variable changes
  • Contains experimental features
  • Performance regression: Consumes more CPU
  • Performance regression: Consumes more Memory
  • Other

The Download function in the downloader.DepDownloader struct did not verify whether the cache folder of the package contained a kcl.mod file, and incorrectly skipped downloading the module. As a result, when downloader.FindPackageByModSpec returned an error, the run was interrupted.

However, a proper check for the kcl.mod file already exists further down in the downloader.DepDownloader.Download function.

4. Are there any breaking changes?(Y/N) and describe the breaking changes(e.g. more details, motivations or doc link):

  • N
  • Y

5. Are there test cases for these changes?(Y/N) select and add more details, references or doc links:

  • Unit test
  • Integration test
  • Benchmark (add benchmark stats below)
  • Manual test (add detailed scripts or steps below)
  • Other

@wolfchkov wolfchkov force-pushed the fix-skip-dep-download branch from b9e9056 to 62411b7 Compare September 3, 2025 09:02
@wolfchkov
Copy link
Author

wolfchkov commented Sep 3, 2025

I see that a PR already exists #631 that fixes the same issue, but it is a draft from May.

@wolfchkov
Copy link
Author

wolfchkov commented Sep 3, 2025

@Peefy, please take a look.

Copy link
Contributor

@Peefy Peefy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! LGTM!

@Peefy Peefy merged commit b6d1809 into kcl-lang:main Sep 7, 2025
5 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Prevent skipping dependency download when cache folder is empty Enhancement: kpm add command displaying optimization

2 participants